import { Component, Input, NgModule, HostBinding } from '@angular/core';


@Component({
    selector: 'deliver',
    template: `
        <div class="deliver noshrink {{className}}" [ngStyle]="deliverStyle" fxLayout="column" fxLayoutAlign="center center">
            <span class="text-xxl">{{employee.user.name.length > 2 ? employee.user.name.substring(employee.user.name.length-2) : employee.user.name}}</span>
            <!--<span class="margin-t-s">{{employee.hasDeliveriedCount}}</span>-->
        </div>
    `,
    styleUrls: ['./home.component.scss']
})

export class Deliver {
    @Input() employee;
    @Input() deliverStyle;

    @HostBinding('class.heightAuto') someField: boolean = true;

    private colorClassList = ["bd-orange", "bd-yellow", "bd-blue"];
    private colorClassIndex = Math.floor(Math.random() * this.colorClassList.length);
    get className() {
        let colorClass = this.colorClassList[this.colorClassIndex];
        return colorClass;
    }
}